home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / Direct3D / Pick / readme.txt < prev    next >
Text File  |  2001-10-10  |  2KB  |  49 lines

  1. //-----------------------------------------------------------------------------
  2. // Name: Pick Direct3D Sample
  3. // 
  4. // Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
  5. //-----------------------------------------------------------------------------
  6.  
  7.  
  8. Description
  9. ===========
  10.    The Pick sample shows how to implement "picking" which is finding which
  11.    triangle in a mesh is intersected by a ray. In this case, the ray comes 
  12.    from mouse coordinates.
  13.  
  14.  
  15. Path
  16. ====
  17.    Source:     DXSDK\Samples\Multimedia\D3D\Pick
  18.    Executable: DXSDK\Samples\Multimedia\D3D\Bin
  19.  
  20.  
  21. User's Guide
  22. ============
  23.    The following keys are implemented. The dropdown menus can be used for the
  24.    same controls.
  25.       <Enter>     Starts and stops the scene
  26.       <Space>     Advances the scene by a small increment
  27.       <F1>        Shows help or available commands.
  28.       <F2>        Prompts user to select a new rendering device or display mode
  29.       <Alt+Enter> Toggles between fullscreen and windowed modes
  30.       <Esc>       Exits the app.
  31.    
  32.    Use the mouse to "pick" any spot in the mesh to see that triangle.
  33.  
  34.  
  35. Programming Notes
  36. =================
  37.    When the user clicks the mouse, the code reads the screen coordinates of the 
  38.    cursor.  These coordinates are converted, via the projection and view matrices,
  39.    into a ray which goes from the eye point through the point clicked on the screen
  40.    and into the scene.  This ray is passed to IntersectTriangle along with each
  41.    triangle of the loaded model to determine which triangles, if any, are 
  42.    intersected by the ray.  The texture coordinates of the intersected triangle
  43.    is also determined.
  44.  
  45.    This sample makes use of common DirectX code (consisting of helper functions,
  46.    etc.) that is shared with other samples on the DirectX SDK. All common
  47.    headers and source code can be found in the following directory:
  48.       DXSDK\Samples\Multimedia\Common
  49.